%!PS-Adobe-3.0
%%Title: Diplomacy Map
%%Creator: dpmap, using a map created with DPeye
%%DocumentPaperSizes: Letter
%%LanguageLevel: 2
%%Orientation: Landscape
%%Pages: (atend)
%%DocumentNeededResources: font Helvetica-Bold Courier Courier-Bold Times-Roman
%%+ font Helvetica
%%EndComments

%%BeginDefaults
%%PageResources: font Helvetica-Bold Courier Courier-Bold Times-Roman Helvetica
%%EndDefaults

% INFO
% MAP

%%BeginSetup
%<Play Setup /$RetreatColor ArrowRed /$SpaceChar 32 /$HalfSlashThickness 5>
%<+ /$MapUnitScale $MapDrawingScale /$FixedFontHeightRatio 1 /$MapNumberScale>
%<+ $MapDrawingScale /$BuildRadius 24 /$FrameOverlap 0 /$HeadLength 20>
%<+ /$MoveRadius 8 /$FrameMargin {$FrameThickness 2 div} /$MapUnitLetterSize 14>
%<+ /$TextFontWidthRatio $FixedFontWidthRatio /$MapImageLeft 0 /$PageHeight 612>
%<+ /$FrameInnerColor LandBrown /$MapImageRight 75 /$SwitchToMapMode>
%<+ SwitchToMapMode /$InitModes {/FinishReport {} def /InTextMode true def}>
%<+ /$TextFontHeight {$TextFontHeightRatio $TextFontSize mul} /$MapUnitOffsetX>
%<+ 0 /$MapUnitOffsetY 8 /$MapNameOffsetX 0 /$FixedFontWidthRatio .6>
%<+ /$ArrowLineThickness 1 /$MapNameOffsetY -14 /$TextFontHeightRatio>
%<+ $FixedFontHeightRatio /$PageWidth 792 /$AbsoluteRoundingError .001>
%<+ /$HalfSlashLength 16 /$HalfHeadThickness 5 /$MaxNumberLength 4>
%<+ /$MapNameFontSize 14 /$FrameOuterColor Black /$MapImageTop 70>
%<+ /$ConvoyRadius 12 /$HalfThickness 1 /$MapNumberSize 14 /$MapSupplyScale>
%<+ $MapDrawingScale /$TextFontWidth {$TextFontWidthRatio $TextFontSize mul}>
%<+ /$MapImageBottom 0 /$BuildColor ArrowWhite /$HoldRadius 24 /$MapNameScale>
%<+ $MapUnitScale /$FrameThickness 4 /$FinishModes { InTextMode { FinishReport>
%<+ } { grestore } ifelse } /$MapDrawingScale .1>

%<Play Definitions>

%<Act Shorthand>
/bd { bind def } bind def
/xd { exch def } bd
/ld { load def } bd
%</Act>

%<Sketch Math>
%$ /ifloor { $AbsoluteRoundingError add floor cvi } bd
/ifloor { .001 add floor cvi } bd
%$ /iceiling { $AbsoluteRoundingError sub ceiling cvi } bd
/iceiling { .001 sub ceiling cvi } bd
/min { 2 copy gt { exch } if pop } bd
/max { 2 copy lt { exch } if pop } bd
/secure_atan { 2 copy 0 eq exch 0 eq and { pop pop 0 } { atan } ifelse } bd
/center { 3 2 roll add 2 div 3 1 roll add 2 div exch } bd
%</Sketch>

%<Act Powers>
/Powers 20 dict def
%</Act>

%<Sketch MapUnitDefinitions>
%%IncludeResource: font Helvetica-Bold
%$ /MapUnitLetterFont /Helvetica-Bold findfont $MapUnitLetterSize scalefont def
/MapUnitLetterFont /Helvetica-Bold findfont 14 scalefont def
%</Sketch>

%<Sketch MapNameDefinitions>
%%IncludeResource: font Helvetica-Bold
%$ /MapNameFont /Helvetica-Bold findfont $MapNameFontSize scalefont def
/MapNameFont /Helvetica-Bold findfont 14 scalefont def
%</Sketch>

%<Sketch TextColumnDefinitions>
%%IncludeResource: font Courier
/TextFixedFont /Courier findfont def
%</Sketch>

%<Sketch TextHeadingDefinitions>
%%IncludeResource: font Courier-Bold
/TextHeadingFont /Courier-Bold findfont def
%</Sketch>

%<Sketch TextTitleDefinitions>
%%IncludeResource: font Times-Roman
/TextTitleFont /Times-Roman findfont def
%</Sketch>

%<Sketch MapNumberDefinitions>
%%IncludeResource: font Helvetica
%$ /MapNumberFont /Helvetica findfont $MapNumberSize scalefont def
/MapNumberFont /Helvetica findfont 14 scalefont def
%</Sketch>

%</Play>

%<Play Chapters /references {() PageLayout MapImageScale} /define bd>

%<Chapter PageSetup>
/PageSetup {

%<Sketch TurnLandscape>
	%$ $PageHeight 0 translate
	612 0 translate
	90 rotate
%</Sketch>

%<Sketch SetupGState>
	%$ $InitModes
	/FinishReport { } def /InTextMode true def
	ArrowBlack
%</Sketch>

} bd
%</Chapter>

%<Chapter ShowPage>
/ShowPage {
	%$ $FinishModes
	InTextMode { FinishReport } { grestore } ifelse
	showpage

%<Part none/>

} bd
%</Chapter>

%<Chapter VisitColors>
/VisitColors {
	3 dict begin
	/c xd /r xd /g xd

%<Scene GrayColors /operator g /format {name 1}>
	/Black 0 g
	/White .9 g
	/Grey .7 g
	/DarkGrey .5 g
	/BorderBlack .1 g
	/MountainGrey .5 g
	/IceGrey .9 g
	/ArrowBlack 0 g
	/ArrowWhite .9 g
%</Scene>

%<Scene RGBColors /operator r /format {name 3}>
	/Red 1 0 0 r
	/Blue 0 0 1 r
	/Mauve 1 0 1 r
	/Magenta 1 0 1 r
	/Yellow 1 1 0 r
	/Green 0 .7 0 r
	/Brown .6 .45 .2 r
	/Turquoise .2 .7 .7 r
	/LightBlue .4 .6 1 r
	/DarkGreen 0 .4 0 r
	/LightGreen 0 .9 0 r
	/Forest 0 .5 0 r
	/Teal 0 .6 .6 r
	/Tan .6 .6 .2 r
	/Cyan 0 1 1 r
	/Orange 1 .6 0 r
	/LandBrown .8 .7 .4 r
	/SeaBlue .1 .4 .6 r
	/ArrowRed 1 0 0 r
	/@Maroon .502 0 0 r
	/@FireBrick .698 .133 .133 r
	/@DarkRed .545 0 0 r
	/@Orange 1 .647 0 r
	/@OrangeRed 1 .271 0 r
	/@Gold 1 .843 0 r
	/@Pink 1 .753 .796 r
	/@HotPink 1 .412 .706 r
	/@DeepPink 1 .078 .576 r
	/@Purple .502 0 .502 r
	/@Green 0 .502 0 r
	/@Olive .502 .502 0 r
	/@Lime 0 1 0 r
	/@LimeGreen .196 0.804 .196 r
	/@SpringGreen 0 1 .498 r
	/@Navy 0 0 .502 r
%</Scene>

%<Scene CMYKColors /operator c /format {name 4}>
	/&Maroon 0 .502 .502 .498 c
	/&FireBrick 0 .809 .809 .302 c
	/&Orange 0 .353 1 0 c
	/&OrangeRed 0 .729 1 0 c
	/&Gold 0 .157 1 0 c
	/&Pink 0 .247 .204 0 c
	/&HotPink 0 .588 .294 0 c
	/&DeepPink 0 .922 .424 0 c
	/&Purple 0 1 0 .498 c
	/&Green 1 0 1 .498 c
	/&Lime 1 0 1 0 c
	/&LimeGreen .756 0 .756 .196 c
	/&SpringGreen 1 0 .502 0 c
%</Scene>

	end
} bd
%</Chapter>

%<Chapter VisitPowers>
/VisitPowers {
	1 dict begin
	/p xd

%<Scene Powers /operator p /format {uname ustring name name}>
	/UNOWNED (?) /Brown /White p
%</Scene>

	end
} bd
%</Chapter>

%<Chapter DrawFleet>
/DrawFleet {
	%$ $SwitchToMapMode
	SwitchToMapMode
	Power begin
	gsave
	translate

%<Sketch LocateTroop>
	%$ $MapUnitScale dup scale
	.1 .1 scale
	%$ $MapUnitOffsetX $MapUnitOffsetY translate
	0 8 translate
%</Sketch>

%<Act PaintFleet>
	2 setlinewidth [] 0 setdash
	newpath
	-26 -7 moveto 0 5 rlineto 7 0 rlineto 0 1 rlineto   % to bow
	-3 0 rlineto 0 1 rlineto 7 0 rlineto 0 1 rlineto    % A turret
	-3 0 rlineto 0 1 rlineto 8 0 rlineto 0 -2 rlineto   % B turret
	1 0 rlineto 0 4 rlineto 1 0 rlineto 0 2 rlineto     % conn tower
	2 0 rlineto 0 -1 rlineto 1 0 rlineto 0 4 rlineto    % Infra struct
	2 0 rlineto 0 5 rlineto 1 0 rlineto 0 -5 rlineto    % funnel 1
	2 0 rlineto 0 -4 rlineto 1 0 rlineto 0 3 rlineto    % funnel 2
	2 0 rlineto 0 5 rlineto 1 0 rlineto 0 -5 rlineto    % mast 2
	2 0 rlineto 0 -8 rlineto 2 0 rlineto 0 2 rlineto    % funnel 2
	8 0 rlineto 0 -1 rlineto -3 0 rlineto 0 -1 rlineto  % C turret
	7 0 rlineto 0 -1 rlineto -3 0 rlineto 0 -1 rlineto  % D turret
	6 0 rlineto 0 -1 rlineto 2 0 rlineto 0 -2 rlineto   % stern
	-1 0 rlineto 0 -2 rlineto
	closepath
	gsave Contrast stroke grestore
	PieceColour fill
%</Act>

%<Act PaintLetter>
	Offset aload pop moveto
	MapUnitLetterFont setfont
	Contrast Letter show
%</Act>

	grestore
	end
} bd
%</Chapter>

%<Chapter DrawArmy>
/DrawArmy {
	%$ $SwitchToMapMode
	SwitchToMapMode
	Power begin
	gsave
	translate

%<Sketch LocateTroop>
	%$ $MapUnitScale dup scale
	.1 .1 scale
	%$ $MapUnitOffsetX $MapUnitOffsetY translate
	0 8 translate
%</Sketch>

%<Act PaintArmy>
	3 setlinewidth [] 0 setdash
	newpath
	-20 7 moveto 30 0 rlineto 0 -4 rlineto 4 0 rlineto
	0 -2 rlineto -30 0 rlineto 0 2 rlineto -4 0 rlineto
	0 4 rlineto                                         % barrel
	4 2 moveto 20 -10 rlineto 2 0 rlineto -8 0 rlineto
	-20 10 rlineto                                      % carriage
	Contrast stroke
	0 0 9 0 360 arc                                     % wheel
	closepath
	Contrast stroke
	newpath
	-20 7 moveto 30 0 rlineto 0 -4 rlineto 4 0 rlineto
	0 -2 rlineto -30 0 rlineto 0 2 rlineto -4 0 rlineto
	0 4 rlineto                                         % barrel
	4 2 moveto 20 -10 rlineto 2 0 rlineto -8 0 rlineto
	-20 10 rlineto                                      % carriage
	PieceColour fill
	0 0 9 0 360 arc                                     % wheel
	closepath
	PieceColour fill
%</Act>

%<Act PaintLetter>
	Offset aload pop moveto
	MapUnitLetterFont setfont
	Contrast Letter show
%</Act>

	grestore
	end
} bd
%</Chapter>

%<Chapter DrawAlias>
/DrawAlias {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave
	3 1 roll translate

%<Sketch LocateName>
	%$ $MapNameScale dup scale
	.1 .1 scale
	%$ $MapNameOffsetX $MapNameOffsetY translate
	0 -14 translate
%</Sketch>

%<Act PaintName>
	MapNameFont setfont
	dup stringwidth pop -2 div 0 neg moveto show
%</Act>

	grestore
} bd
%</Chapter>

%<Chapter DrawName>
/DrawName {
	pop pop pop

%<Part none/>

} bd
%</Chapter>

%<Chapter VisitTerritories /format {ustring value value} /$NumberOfScenes 0>
/VisitTerritories {
	%$ $NumberOfScenes dict begin
	0 dict begin

%<Act Operators/>

	end
} bd
%</Chapter>

%<Chapter VisitSupplies /format {uname value value} /$NumberOfScenes 0>
/VisitSupplies {
	%$ $NumberOfScenes dict begin
	0 dict begin

%<Act Operators/>

	end
} bd
%</Chapter>

%<Chapter supply>
/supply {
	%$ $SwitchToMapMode
	SwitchToMapMode
	Power begin
	gsave
	translate

%<Sketch LocateSupply>
	%$ $MapSupplyScale dup scale
	.1 .1 scale
%</Sketch>

%<Act PaintSupply>
	PieceColour
	newpath 0 0 4 0 360 arc fill
%</Act>

	grestore
	end
} bd
%</Chapter>

%<Chapter VisitShapePoints /format {name value value} /$NumberOfScenes 1>
/VisitShapePoints {
	%$ $NumberOfScenes dict begin
	1 dict begin

%<Act Operators>
	/x xd
%</Act>

%<Scene Sail /operator x>
	/m 17 1 x
	/l 8 3 x
	/l 4 9 x
	/l 2 22 x
	/l 1 24 x
	/l 3 24 x
	/l 4 23 x
	/l 11 23 x
	/l 13 19 x
	/l 16 16 x
	/l 18 16 x
	/l 18 18 x
	/l 14 21 x
	/l 12 25 x
	/l 9 38 x
	/l 27 40 x
	/l 27 45 x
	/l 20 45 x
	/l 22 61 x
	/l 27 61 x
	/l 27 68 x
	/l 28 68 x
	/l 28 64 x
	/l 28 61 x
	/l 32 61 x
	/l 34 45 x
	/l 29 45 x
	/l 29 40 x
	/l 45 40 x
	/l 44.75 38.25 x
	/l 43 38 x
	/l 43 32 x
	/l 42 20 x
	/l 38 16 x
	/l 34 16 x
	/l 34 12 x
	/l 37 12 x
	/l 46 21 x
	/l 52 21 x
	/l 52 23 x
	/l 45 23 x
	/l 44 27 x
	/l 44 37 x
	/l 54 38 x
	/l 54 49 x
	/l 55 49 x
	/l 55 38 x
	/l 65 37 x
	/l 65 32 x
	/l 63.25 30 x
	/l 58 30 x
	/l 58 23 x
	/l 54 23 x
	/l 54 21 x
	/l 59 21 x
	/l 59 29 x
	/l 64 29 x
	/l 73 39 x
	/l 74 38 x
	/l 67 29 x
	/l 75 29 x
	/l 75 22 x
	/l 74 20 x
	/l 66 20 x
	/l 61 17 x
	/l 58 11 x
	/l 56 4 x
	/l 54 2 x
	/p 44 1 x
%</Scene>

	end
} bd
%</Chapter>

%<Chapter LocateArrow>
/LocateArrow {

%<Sketch LocateArrow>
	3 index 3 index translate
	3 2 roll sub 3 1 roll exch sub exch
	2 copy dup mul exch dup mul add sqrt 3 1 roll exch secure_atan
	%$ $MapUnitScale dup scale
	.1 .1 scale
	%$ $MapUnitOffsetX $MapUnitOffsetY translate
	0 8 translate
	%$ rotate $MapUnitScale div
	rotate .1 div
%</Sketch>

} bd
%</Chapter>

%<Chapter PaintArrowMove>
/PaintArrowMove {
	gsave
	LocateArrow

%<Sketch ArrowMoveBase>
	%$ $HeadLength sub
	20 sub
%</Sketch>

%<Sketch ShortenArrowTail>
	% if base of arrow is long enough, shorten it enough
	% to e.g. move arrow start beyond support circle
	%$ dup $MapUnitLetterSize gt {
	dup 14 gt {
		%$ $MapUnitLetterSize dup 0 translate sub
		14 14 0 translate sub
	} {
		0 translate 0
	} ifelse
%</Sketch>

%<Sketch ShortenArrowTip>
	% if base is still too long, shorten it some more
	% to make arrow head touch support circle
	%$ dup $MapUnitLetterSize gt {
	dup 14 gt {
		%$ $MapUnitLetterSize sub
		14 sub
	} {
		pop 0
	} ifelse
%</Sketch>

%<Sketch PaintArrowMove>
	% draw the arrow head ...
	%$ $ArrowLineThickness setlinewidth
	1 setlinewidth
	newpath
	%$ dup $HalfHeadThickness neg moveto
	dup -5 moveto
	%$ dup $HeadLength add 0 lineto
	dup 20 add 0 lineto
	%$ dup $HalfHeadThickness lineto
	dup 5 lineto
	closepath stroke
	% now the shaft ...
	%$ $HalfThickness 2 mul setlinewidth
	2 setlinewidth
	0 0 moveto
	0 lineto
	stroke
%</Sketch>

	grestore
} bd
%</Chapter>

%<Chapter PaintArrowRetreat>
/PaintArrowRetreat {
	gsave
	LocateArrow

%<Sketch ArrowRetreatBase>
	%$ $HeadLength 2 mul $HalfThickness $HalfHeadThickness div sub sub
	39.8 sub
%</Sketch>

%<Sketch ShortenArrowTail>
	% if base of arrow is long enough, shorten it enough
	% to e.g. move arrow start beyond support circle
	%$ dup $MapUnitLetterSize gt {
	dup 14 gt {
		%$ $MapUnitLetterSize dup 0 translate sub
		14 14 0 translate sub
	} {
		0 translate 0
	} ifelse
%</Sketch>

%<Sketch ShortenArrowTip>
	% if base is still too long, shorten it some more
	% to make arrow head touch support circle
	%$ dup $MapUnitLetterSize gt {
	dup 14 gt {
		%$ $MapUnitLetterSize sub
		14 sub
	} {
		pop 0
	} ifelse
%</Sketch>

%<Sketch PaintArrowRetreat>
	%$ $RetreatColor
	ArrowRed
	% draw the double arrow head ...
	%$ $ArrowLineThickness setlinewidth
	1 setlinewidth
	newpath
	%$ dup $HalfHeadThickness neg moveto
	dup -5 moveto
	%$ dup $HeadLength $HalfThickness $HalfHeadThickness div sub add
	dup 19.8 add
	%$ dup $HalfThickness neg lineto
	dup -1 lineto
	%$ dup $HalfHeadThickness neg lineto
	dup -5 lineto
	%$ dup $HeadLength add 0 lineto
	dup 20 add 0 lineto
	%$ dup $HalfHeadThickness lineto
	dup 5 lineto
	%$ $HalfThickness lineto
	1 lineto
	%$ dup $HalfHeadThickness lineto
	dup 5 lineto
	closepath stroke
	% now the shaft ...
	%$ $HalfThickness 2 mul setlinewidth
	2 setlinewidth
	0 0 moveto
	0 lineto
	stroke
%</Sketch>

	grestore
} bd
%</Chapter>

%<Chapter PaintArrowCircle>
/PaintArrowCircle {
	gsave
	5 1 roll LocateArrow

%<Sketch ArrowCircleBase>
	1 index sub
%</Sketch>

%<Sketch ShortenArrowTail>
	% if base of arrow is long enough, shorten it enough
	% to e.g. move arrow start beyond support circle
	%$ dup $MapUnitLetterSize gt {
	dup 14 gt {
		%$ $MapUnitLetterSize dup 0 translate sub
		14 14 0 translate sub
	} {
		0 translate 0
	} ifelse
%</Sketch>

%<Sketch PaintArrowCircle>
	% draw the circle ...
	%$ $ArrowLineThickness setlinewidth
	1 setlinewidth
	newpath
	2 copy add 0 4 3 roll 0 360 arc
	closepath stroke
	% now the shaft ...
	%$ $HalfThickness 2 mul setlinewidth
	2 setlinewidth
	0 0 moveto
	0 lineto
	stroke
%</Sketch>

	grestore
} bd
%</Chapter>

%<Chapter ArrowMove>
/ArrowMove {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave

%<Part none/>

	PaintArrowMove
	grestore
} bd
%</Chapter>

%<Chapter ArrowRetreat>
/ArrowRetreat {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave

%<Part none/>

	PaintArrowRetreat
	grestore
} bd
%</Chapter>

%<Chapter ArrowHold>
/ArrowHold {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave

%<Part none/>

	%$ $HoldRadius PaintArrowCircle
	24 PaintArrowCircle
	grestore
} bd
%</Chapter>

%<Chapter ArrowSupport>
/ArrowSupport {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave

%<Part none/>

	center
	%$ $MoveRadius PaintArrowCircle
	8 PaintArrowCircle
	grestore
} bd
%</Chapter>

%<Chapter ArrowConvoy>
/ArrowConvoy {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave

%<Part none/>

	center
	%$ $ConvoyRadius PaintArrowCircle
	12 PaintArrowCircle
	grestore
} bd
%</Chapter>

%<Chapter BuildUnit>
/BuildUnit {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave
	translate

%<Sketch LocateTroop>
	%$ $MapUnitScale dup scale
	.1 .1 scale
	%$ $MapUnitOffsetX $MapUnitOffsetY translate
	0 8 translate
%</Sketch>

%<Sketch PaintBuildCircle>
	%$ $BuildColor
	ArrowWhite
	6 setlinewidth [ 1 8 ] 0 setdash
	newpath
	%$ 0 0 $BuildRadius 0 360 arc
	0 0 24 0 360 arc
	closepath stroke
%</Sketch>

	grestore
} bd
%</Chapter>

%<Chapter SlashUnit>
/SlashUnit {
	gsave
	3 1 roll translate

%<Sketch LocateTroop>
	%$ $MapUnitScale dup scale
	.1 .1 scale
	%$ $MapUnitOffsetX $MapUnitOffsetY translate
	0 8 translate
%</Sketch>

%<Sketch PaintSlash>
	newpath
	%$ $HalfSlashThickness neg $HalfSlashLength sub $HalfSlashLength neg moveto
	-21 -16 moveto
	%$ $HalfSlashThickness neg $HalfSlashLength add $HalfSlashLength lineto
	11 16 lineto
	%$ $HalfSlashThickness $HalfSlashLength add $HalfSlashLength lineto
	21 16 lineto
	%$ $HalfSlashThickness $HalfSlashLength sub $HalfSlashLength neg lineto
	-11 -16 lineto
	closepath
%</Sketch>

	exec
	grestore
} bd
%</Chapter>

%<Chapter DestroyUnit>
/DestroyUnit {
	%$ $SwitchToMapMode
	SwitchToMapMode
	%$ { $RetreatColor fill } SlashUnit
	{ ArrowRed fill } SlashUnit

%<Part none/>

} bd
%</Chapter>

%<Chapter DisbandUnit>
/DisbandUnit {
	%$ $SwitchToMapMode
	SwitchToMapMode
	%$ { gsave $BuildColor fill grestore $RetreatColor stroke $ArrowLineThickness setlinewidth [] 0 setdash } SlashUnit
	{ gsave ArrowWhite fill grestore ArrowRed stroke 1 setlinewidth [ ] 0 setdash } SlashUnit

%<Part none/>

} bd
%</Chapter>

%<Chapter RemoveUnit>
/RemoveUnit {
	%$ $SwitchToMapMode
	SwitchToMapMode
	%$ { $BuildColor fill } SlashUnit
	{ ArrowWhite fill } SlashUnit

%<Part none/>

} bd
%</Chapter>

%<Chapter OkOrder>
/OkOrder {
	%$ $SwitchToMapMode
	SwitchToMapMode

%<Act OkOrder>
	[] 0 setdash
%</Act>

} bd
%</Chapter>

%<Chapter FailedOrder>
/FailedOrder {
	%$ $SwitchToMapMode
	SwitchToMapMode

%<Act FailedOrder>
	[4 6] 2 setdash
%</Act>

} bd
%</Chapter>

%<Chapter SplitString>
/SplitString {

%<Sketch SplitString>
	7 dict begin
	/nrChars xd
	/indentString xd
	/objectString xd
	/objectLast objectString length 1 sub def
	% Short string?
	objectLast nrChars lt {
		false objectString
	} {
		% Look for a suitable place to split.
		% First tracking backwards, if that doesn't work, look forward.
		/splitIndex -1 def
		nrChars -1 0 {
			%$ objectString 1 index get $SpaceChar eq {
			objectString 1 index get 32 eq {
				/splitIndex xd exit
			} if pop
		} for splitIndex -1 eq {
			nrChars 1 add 1 objectLast {
				%$ objectString 1 index get $SpaceChar eq {
				objectString 1 index get 32 eq {
					/splitIndex xd exit
				} if pop
			} for
		} if
		splitIndex -1 eq splitIndex objectLast eq or {
			false objectString
		} {
			% The first part.
			objectString 0 splitIndex getinterval
			% The second part.
			objectString splitIndex 1 add objectLast splitIndex sub getinterval
			% Add indentation if needed.
			indentString length 0 gt {
				dup length indentString length add string
				dup 0 indentString putinterval
				dup indentString length 4 3 roll putinterval
			} if
			% Add white space of the first part.
			/nonSpaceIndex objectLast 1 add def
			0 1 objectLast {
				%$ objectString 1 index get $SpaceChar ne {
				objectString 1 index get 32 ne {
					/nonSpaceIndex xd exit
				} if pop
			} for
			nonSpaceIndex 0 gt nonSpaceIndex splitIndex lt and {
				dup length nonSpaceIndex add string
				dup 0 objectString 0 nonSpaceIndex getinterval putinterval
				dup nonSpaceIndex 4 3 roll putinterval
			} if
			exch true exch
		} ifelse
	} ifelse
	end
%</Sketch>

} bd
%</Chapter>

%<FrameLayout PageLayout /$SetTextFont { TextFixedFont $TextFontSize# scalefont>
%<+ setfont } /references { Map { ImageGrid ImageFrame Image } { Left Bottom>
%<+ Width Height ImageScale FrameLeft FrameBottom FrameWidth FrameHeight } }>
%<+ /$MapFrameBottom 26.0 /$MapFrameHeight 560 /layout ImageGrid>
%<+ /$MapImageScale 8.057142857142857 /marginWidth 20 /$MapBottom 24.0 /height>
%<+ $PageHeight /$TextFontSize 8 /$MapLeft 93.85714285714283 /$MapFrameLeft>
%<+ 93.85714285714283 /marginHeight 20 /type proc /width $PageWidth /fitWidth 1>
%<+ /define bd /fitHeight 1 /$MapFrameWidth 604.2857142857143>

%<Chapter DrawBorders>
/DrawBorders {
	gsave
	%$ $SetTextFont
	TextFixedFont 8 scalefont setfont

%<Part none/>

	grestore
} bd
%</Chapter>

%<GridLayout ImageGrid /cellWidth $TextFontWidth /cellHeight $TextFontHeight>
%<+ /fitWidth 2 /fitHeight 2 /layout ImageFrame>

%<FrameLayout ImageFrame /$MarginHeight 2.0 /marginWidth $FrameMargin>
%<+ /$MarginWidth 72.25714285714287 /fitWidth 2 /fitHeight 2 /layout Image>
%<+ /marginHeight $FrameMargin>

%<ImageLayout Image /$Bottom 24.0 /widthPriority 5 /$FrameLeft { $Left>
%<+ $FrameThickness $MarginWidth sub $FrameOverlap max add } /imageWidth {>
%<+ $MapImageRight $MapImageLeft sub } /imageHeight { $MapImageTop>
%<+ $MapImageBottom sub } /$FrameBottom { $Bottom $FrameThickness $MarginHeight>
%<+ sub $FrameOverlap max add } /$Height 564 /$FrameWidth { $Width>
%<+ $FrameThickness $MarginWidth sub $FrameOverlap max 2 mul sub }>
%<+ /$FrameHeight { $Height $FrameThickness $MarginHeight sub $FrameOverlap max>
%<+ 2 mul sub } /heightPriority 5 /$Width 604.2857142857143 /$Left>
%<+ 93.85714285714283>

%<Chapter DrawFrame>
/DrawFrame {
	gsave

%<Sketch DrawFrame /$FrameInnerHeight { $FrameOuterHeight $FrameInnerThickness>
%<+ sub } /$FrameInnerBottom {$FrameOuterBottom $FrameInnerThickness 2 div add}>
%<+ /$FrameOuterLeft {$FrameLeft $FrameOuterThickness 2 div sub}>
%<+ /$FrameInnerLeft {$FrameOuterLeft $FrameInnerThickness 2 div add}>
%<+ /$FrameOuterWidth {$FrameWidth $FrameOuterThickness add}>
%<+ /$FrameOuterThickness $FrameThickness /$FrameInnerWidth { $FrameOuterWidth>
%<+ $FrameInnerThickness sub } /$FrameOuterHeight { $FrameHeight>
%<+ $FrameOuterThickness add } /$FrameOuterBottom { $FrameBottom>
%<+ $FrameOuterThickness 2 div sub } /$FrameInnerThickness { $FrameThickness 4>
%<+ div }>
	%$ $FrameOuterColor $FrameOuterThickness# setlinewidth
	Black 4 setlinewidth
	%$ $FrameOuterLeft# $FrameOuterBottom# $FrameOuterWidth# $FrameOuterHeight# rectstroke
	91.86 24 608.29 564 rectstroke
	%$ $FrameInnerColor $FrameInnerThickness# setlinewidth
	LandBrown 1 setlinewidth
	%$ $FrameInnerLeft# $FrameInnerBottom# $FrameInnerWidth# $FrameInnerHeight# rectstroke
	92.36 24.5 607.29 563 rectstroke
%</Sketch>

	grestore
} bd
%</Chapter>

%</ImageLayout>

%</FrameLayout>

%</GridLayout>

%<Chapter OwnerReport>
/OwnerReport {

%<Part none/>

} bd
%</Chapter>

%<Chapter WriteOwner>
/WriteOwner {
	pop

%<Part none/>

} bd
%</Chapter>

%<Chapter AdjustReport>
/AdjustReport {

%<Part none/>

} bd
%</Chapter>

%<Chapter WriteAdjust>
/WriteAdjust {
	pop

%<Part none/>

} bd
%</Chapter>

%<Chapter RetreatReport>
/RetreatReport {

%<Part none/>

} bd
%</Chapter>

%<Chapter WriteRetreat>
/WriteRetreat {
	pop

%<Part none/>

} bd
%</Chapter>

%<Chapter OrderReport>
/OrderReport {

%<Part none/>

} bd
%</Chapter>

%<Chapter WriteOrder>
/WriteOrder {
	pop

%<Part none/>

} bd
%</Chapter>

%<Chapter DrawTitle>
/DrawTitle {
	pop

%<Part none/>

} bd
%</Chapter>

%<Chapter SwitchToTextMode>
/SwitchToTextMode {

%<Act SwitchToTextMode>
	InTextMode {
		FinishReport /FinishReport {} def
	} {
		grestore /InTextMode true def
	} ifelse
%</Act>

} bd
%</Chapter>

%<Chapter SwitchToMapMode /$ClipEdge { $MapFrameLeft $MapFrameBottom>
%<+ $MapFrameWidth $MapFrameHeight rectclip } /$OkOrder {[] 0 setdash}>
/SwitchToMapMode {

%<Sketch SwitchToMapMode>
	InTextMode {
		FinishReport /FinishReport { } def
		/InTextMode false def
		gsave
		%$ $ClipEdge
		%93.85714285714283 26.0 604.2857142857143 560 rectclip
		%$ $MapLeft# $MapBottom# translate $MapImageScale#4 dup scale $MapImageLeft# neg $MapImageBottom# neg translate
		93.86 24 translate 8.0571 8.0571 scale
		%$ $OkOrder
		[ ] 0 setdash
	} if
%</Sketch>

} bd
%</Chapter>

%</FrameLayout>

%<Chapter PaintMap>
/PaintMap {
	%$ $SwitchToMapMode
	SwitchToMapMode
	3 dict begin
	/m /moveto ld /l /lineto ld /c /curveto ld
	gsave

%<Act ScaleMap>
	1 6 div dup scale
%</Act>

%<Act PaintOutlines/>

	grestore
	end
} bd
%</Chapter>

%<Chapter DrawMap>
/DrawMap {
	PageSetup
	PaintMap
	DrawShapePoints
	NumberLocations

%<Part none/>

	DrawAliases
} bd
%</Chapter>

%<Chapter DrawShapePoints /$DrawShape {3 2 roll load exec}>
/DrawShapePoints {
	%$ $SwitchToMapMode
	SwitchToMapMode
	3 dict begin
	/m /moveto ld
	/l /lineto ld
	/p { lineto closepath } bd
	/n { } def
	/a { 4 3 roll 2 index add 2 div 4 3 roll 2 index add 2 div 4 3 roll 2 index sub dup mul 4 3 roll 2 index sub dup mul add sqrt 0 360 arc } bd
	%$ {$DrawShape} bind
	{ 3 2 roll load exec } bind

%<Part none/>

	VisitShapePoints
	gsave Black 2 setlinewidth stroke grestore Yellow fill
	end
} bd
%</Chapter>

%<Chapter DrawAliases>
/DrawAliases {
	NameShapePoints

%<Part none/>

} bd
%</Chapter>

%<Chapter NameShapePoints /$DrawAlias {3 2 roll 4 string cvs DrawAlias}>
/NameShapePoints {
	%$ $SwitchToMapMode
	SwitchToMapMode
	gsave
	%$ {Red $DrawAlias} bind
	{ Red 3 2 roll 4 string cvs DrawAlias } bind

%<Part none/>

	VisitShapePoints
	grestore
} bd
%</Chapter>

%<Chapter PrintNumber>
/PrintNumber {

%<Sketch PrintNumber>
	newpath
	%$ $MaxNumberLength string cvs dup 4 1 roll 0 0 moveto true charpath pathbbox newpath
	4 string cvs dup 4 1 roll 0 0 moveto true charpath pathbbox newpath
	3 -1 roll add 2 div 3 1 roll add 2 div exch
	3 -1 roll sub neg 3 1 roll sub exch moveto show
%</Sketch>

} bd
%</Chapter>

%<Chapter NumberLocations>
/NumberLocations {
	%$ $SwitchToMapMode
	SwitchToMapMode
	3 dict begin
	/bn 1 def /en /pop ld
	/n { 2 index PrintNumber 1 add } bd
	gsave
	%$ MapNumberFont $MapNumberScale scalefont setfont
	MapNumberFont .1 scalefont setfont

%<Play Sail>
	Blue bn

%<Scene Numbers /operator n /format {value value}>
	26.5 67.9165 n
	27.5 63.9165 n
	21.5 60.9165 n
	26.5 60.9165 n
	28.5 60.9165 n
	31.5 60.9165 n
	54.5 48.9165 n
	19.5 44.9165 n
	26.5 44.9165 n
	28.5 44.9165 n
	33.5 44.9165 n
	28.5 39.9165 n
	44.5 39.9165 n
	26.5 38.9165 n
	72.5 38.9165 n
	8.5 37.9165 n
	53.5 37.9165 n
	73.5 37.9165 n
	43.5 36.9165 n
	64.5 36.9165 n
	64.5 32.9165 n
	56.5 30.9165 n
	62.5 30.9165 n
	58.5 28.9165 n
	63.5 28.9165 n
	66.5 28.9165 n
	74.5 28.9165 n
	43.5 26.9165 n
	11.5 24.9165 n
	0.5 23.9165 n
	2.5 23.9165 n
	3.5 22.9165 n
	10.5 22.9165 n
	44.5 22.9165 n
	51.5 22.9165 n
	53.5 22.9165 n
	56.5 22.9165 n
	1.5 21.9165 n
	74.5 21.9165 n
	13.5 20.9165 n
	45.5 20.9165 n
	51.5 20.9165 n
	53.5 20.9165 n
	58.5 20.9165 n
	41.5 19.9165 n
	65.5 19.9165 n
	73.5 19.9165 n
	12.5 18.9165 n
	17.5 17.9165 n
	60.5 16.9165 n
	15.5 15.9165 n
	17.5 15.9165 n
	33.5 15.9165 n
	37.5 15.9165 n
	33.5 11.9165 n
	36.5 11.9165 n
	57.5 10.9165 n
	3.5 8.9165 n
	55.5 3.9165 n
	7.5 2.9165 n
	53.5 1.9164999999999999 n
	16.5 1.0 n
	43.5 1.0 n
%</Scene>

	en
%</Play>

	grestore
	end
} bd
%</Chapter>

%</Play>

%<Play Installations>

%<Act DefineColors>
{
	currentdict end 3 1 roll [ exch /setgray load ] cvx def begin
}{
	currentdict end 5 1 roll [ 4 1 roll /setrgbcolor load ] cvx def begin
}{
	currentdict end 6 1 roll [ 5 1 roll /setcmykcolor load ] cvx def begin
} bind VisitColors
%</Act>

%<Sketch DefinePowers /$Push {} /$Pull {} /$CreatePowerDict { 4 dict begin>
%<+ /Contrast xd /PieceColour xd /Offset xd /Letter xd currentdict end }>
%<+ /$GetLetterOffset { [ exch newpath 0 0 moveto true charpath pathbbox 3 2>
%<+ roll add -2 div 3 1 roll add -2 div exch ] }>
gsave
MapUnitLetterFont setfont
{
	%$ $Push exch load exch load
	exch load exch load
	%$ 2 index $GetLetterOffset 3 1 roll $Pull
	2 index [ exch newpath 0 0 moveto true charpath pathbbox 3 2 roll add -2 div 3 1 roll add -2 div exch ] 3 1 roll
	%$ $CreatePowerDict
	4 dict begin /Contrast xd /PieceColour xd /Offset xd /Letter xd currentdict end
	[ /Power 3 2 roll /def load ] cvx
	currentdict end 3 1 roll def begin
} VisitPowers
grestore
%</Sketch>

%<Act DefineSupplies>
{ currentdict end 4 1 roll [ 3 1 roll ] cvx def begin } bind VisitSupplies
%</Act>

%<Scene Centers /operator ld /format {uname uname}>
/UNOWNEDCENTER /UNOWNED ld
%</Scene>

%</Play>

%</Play>
%%EndSetup

%%Page: Opening 1
%<Play Page>
DrawMap

%<Part none/>

ShowPage
%</Play>

%%Trailer
%%Pages: 1
